#region Imports
using System.Collections.Generic;
using System.ComponentModel.Composition;
using Jounce.Core.View;
using Jounce.Core.ViewModel;
using System;
#endregion

namespace JounceSilverlightDemo.ViewModels
{
    /// <summary>
    /// Sample view model showing design-time resolution of data
    /// </summary>
    [ExportAsViewModel(typeof(MainViewModel))]
    public class MainViewModel : BaseViewModel, IPartImportsSatisfiedNotification
    {
        #region Properties
        private string userName = "< Guest >";
        public string UserName
        {
            get { return userName; }
            set { userName = value; RaisePropertyChanged("UserName"); }
        }
        #endregion

        #region Constructors
        public MainViewModel()
        {
            ;
        }
        #endregion

        #region Core methods
        public void OnImportsSatisfied()
        {
            ;
        }

        protected override void InitializeVm()
        {
            base.InitializeVm();
            NavigateToPages(null);
        }

        protected override void ActivateView(string viewName, IDictionary<string, object> viewParameters)
        {
            ;
        }
        #endregion

        #region Methods
        public void NavigateToPages(object parameter)
        {
            Dictionary<string, object> paramdict = new Dictionary<string, object>();
            EventAggregator.Publish(new ViewNavigationArgs("LoginPage", paramdict));

            EventAggregator.Publish(new ViewNavigationArgs("HeaderPage"));
        }
        #endregion
    }
}
